﻿
@{
    ViewBag.Title = "Show";
    Layout = null;
}

<h2>Show</h2>

@if (User.Identity.IsAuthenticated)
{
    <span style="display:block;margin-top:10px;">@Html.Raw("Hi " + User.Identity.Name + ",")</span>
    
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "logoffForm" }))
    {
        @Html.AntiForgeryToken()
        <a href="javascript:document.getElementById('logoutForm').submit()">注销</a>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li>@Html.ActionLink("注册", "register", "account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        <li>@Html.ActionLink("登录", "login", "account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}
